<!--form starts-->
<div class="form_container">
	<h4>Manage Faqs</h4>
	<!--row starts-->
	<div class="error_msg" style="margin-left:15px;">
		<?php
		if (isset($error) && $error != '') {
			echo $error;
		}?>
	</div>
	<div class="success_msg" style="margin-left:15px;"> 
		<?php if ($this -> session -> userdata('faq_success')) {
			echo $this -> session -> userdata('faq_success');
			$this -> session -> set_userdata('faq_success', '');
		}
		?>
	</div>
	<!--row starts-->
	<div class="row1">
		<div class="form-group col-sm-12">
			<label for="eventname2">Event Name <span class="asterisk">*</span></label>
			<select class="form-control white" required id="select_event" name="select_event" onchange="loadFaq();">
				<option value=""> Choose Event </option>
				<?php if(isset($event_data) && !empty($event_data)){ 
					foreach($event_data as $temp){?>
						<option value="<?php echo $temp['event_id']; ?>" <?php if(isset($event) && $event==$temp['event_id']){echo  'selected';}else if(set_value('selectevent') == $temp['event_id']){ echo 'selected';} ?>><?php echo $temp['event_name']; ?></option>
				<?php }}?>
			</select>
			<input type="hidden" id="faq_url" value="<?php echo BASE_URL.'/'.$this->admin; ?>" />
			<div class="error" id="err-event1"></div>
		</div>
		<div class="clearfix"></div>
	</div>
	<!--row closed-->
	<div class="clearfix space10"></div>
	
	<!--row starts-->
	<?php echo form_open(BASE_URL . '/' . $this -> admin . '/manage_event_faqs', array('id' => 'faq_form', 'method' => 'post')); ?>
	<div class="row1" style="border-top: solid 1px #FF8200;">
		<div class="space10"></div>
		<div class="form-group col-sm-12">
			<label for="faq_q">Question <span class="asterisk">*</span></label>
			<input class="form-control white" required placeholder="Enter Question" id="faq_q" name="faq_q" type="text" value="">
			<div class="error" id="err-faq_q"></div>
		</div>
		<div class="clearfix"></div>
	</div>
	<div class="row1">
		<div class="form-group col-sm-12">
			<label for="faq_a">Answer <span class="asterisk">*</span></label>
			<input class="form-control white" required placeholder="Enter Answer" id="faq_a" name="faq_a" type="text" value="">
			<div class="error" id="err-faq_a"></div>
		</div>
		<div class="clearfix"></div>
	</div>
	<div class="space10"></div>
	<div class="row1" style="border-bottom: solid 1px #FF8200;">
		<div class="form-group col-sm-12">
			<input type="hidden" name="faq_event" id="faq_event" value="" />
			<button type="button" class="btn btn-primary" id="faq_btn">
				Add Faq
			</button>
		</div>
		<div class="clearfix"></div>
	</div>
	<?php echo form_close(); ?>
	<!--row closed-->
	
	<div class="clearfix space20"></div>
	<div class="row1">
		<div class="table-responsive">
	    	<table border="0" cellspacing="0" cellpadding="0" class="manage_table" style="width:97% !important;">
				<tr>
					<td width="5%">&nbsp;</td>
					<td width="40%"><b>Question</b></td> 
					<td><b>Answer</b></td>
					<td width="5%">&nbsp;</td>
				</tr>
				<?php
					if(isset($faq_list) && !empty($faq_list))
					{
						$i=1;
						foreach($faq_list as $temp){?>
				<tr>
					<td><?php echo $i; ?></td>
					<td><?php echo $temp['event_faq_question']; ?></td>
					<td><?php echo $temp['event_faq_answer']; ?></td>
					<td><a href="javascript:void();" onclick="delete_faq('<?php echo $temp['event_faq_id']?>', <?php echo $temp['event_faq_event_id']?>,'<?php echo BASE_URL.'/'.$this -> admin;?>')"><img src="<?php echo ASSET_URL;?>img/admin/delete.png" style="width:20px;" alt="edit"></a></td>
				</tr>			
				<?php
					$i++;}
					}else{
				 ?>
				<tr>
					<td colspan="4">No record found</td>
				</tr>
				<?php }?>
	    	</table>
		</div>
		<div class="clearfix space30"></div>
	</div>
</div>
<!--form closed-->
<div class="space30"></div>